<?php
function get_os(){
	if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
		return "w";
	} else {
		return "l";
	}
}
	
if (get_os() == "w"){
	rename ("c:\\notebubble\\settings_bak.php","c:\\notebubble\\settings.php");
} else {
	$home_dir = posix_getpwnam(get_current_user())['dir'];
	rename ("$home_dir/.local/share/notebubble/settings_bak.php","$home_dir/.local/share/notebubble/settings.php");
}

header('location: index.php');
?>
